/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.ta.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.ta.entity.StDepartment;
import com.thinkgem.jeesite.modules.ta.dao.StDepartmentDao;

/**
 * 部门信息Service
 * @author TTAO
 * @version 2017-05-31
 */
@Service
@Transactional(readOnly = true)
public class StDepartmentService extends TreeService<StDepartmentDao, StDepartment> {

	public StDepartment get(String id) {
		return super.get(id);
	}
	
	public List<StDepartment> findList(StDepartment stDepartment) {
		if (StringUtils.isNotBlank(stDepartment.getParentIds())){
			stDepartment.setParentIds(","+stDepartment.getParentIds()+",");
		}
		return super.findList(stDepartment);
	}
	
	@Transactional(readOnly = false)
	public void save(StDepartment stDepartment) {
		super.save(stDepartment);
	}
	
	@Transactional(readOnly = false)
	public void delete(StDepartment stDepartment) {
		super.delete(stDepartment);
	}
	
}